home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / haziran / 19 / setup.exe / data.z / wd_kp.h < prev    next >
C/C++ Source or Header  |  2001-04-11  |  2KB  |  60 lines

  1. #ifndef _WD_KP_H_
  2. #define _WD_KP_H_
  3.  
  4. #ifndef __KERNEL__
  5.     #define __KERNEL__
  6. #endif
  7.  
  8. #ifndef __KERPLUG__
  9.     #define __KERPLUG__
  10. #endif
  11.  
  12. #include "windrvr.h"
  13.  
  14. #ifdef __cplusplus
  15.     extern "C" {
  16. #endif  // __cplusplus 
  17.  
  18. // called when WD_KernelPlugInClose() is called
  19. typedef void (__cdecl *KP_FUNC_CLOSE)(PVOID pDrvContext);
  20. // called when WD_KernelPlugInCall() is called
  21. typedef void (__cdecl *KP_FUNC_CALL)(PVOID pDrvContext, WD_KERNEL_PLUGIN_CALL *kpCall, BOOL fKernelMode);
  22. // called when WD_IntEnable() is called, with a kernel plugin handler specified
  23. // the pIntContext will be passed to the rest of the functions handling interrupts.
  24. // returns TRUE if enable is succesful
  25. typedef BOOL (__cdecl *KP_FUNC_INT_ENABLE)(PVOID pDrvContext, WD_KERNEL_PLUGIN_CALL *kpCall, PVOID *ppIntContext);
  26. // called when WD_IntDisable() is called
  27. typedef void (__cdecl *KP_FUNC_INT_DISABLE)(PVOID pIntContext);
  28. // returns TRUE if needs DPC.
  29. typedef BOOL (__cdecl *KP_FUNC_INT_AT_IRQL)(PVOID pIntContext, BOOL *pfIsMyInterrupt);
  30. // returns the number of times to notify user-mode (i.e. return from WD_IntWait)
  31. typedef DWORD (__cdecl *KP_FUNC_INT_AT_DPC)(PVOID pIntContext, DWORD dwCount);
  32.  
  33. typedef struct {
  34.     KP_FUNC_CLOSE       funcClose;
  35.     KP_FUNC_CALL        funcCall;
  36.     KP_FUNC_INT_ENABLE  funcIntEnable;
  37.     KP_FUNC_INT_DISABLE funcIntDisable;
  38.     KP_FUNC_INT_AT_IRQL funcIntAtIrql;
  39.     KP_FUNC_INT_AT_DPC  funcIntAtDpc;
  40. } KP_OPEN_CALL;
  41.  
  42. // called when WD_KernelPlugInOpen() is called. pDrvContext returned will be passed to 
  43. // rest of the functions
  44. typedef BOOL (__cdecl *KP_FUNC_OPEN)(KP_OPEN_CALL *kpOpenCall, HANDLE hWD, PVOID pOpenData, PVOID *ppDrvContext);
  45.  
  46. typedef struct {
  47.     DWORD        dwVerWD;        // version of WinDriver library WD_KP.LIB
  48.     CHAR         cDriverName[12]; // return the device driver name, upto 12 chars.
  49.     KP_FUNC_OPEN funcOpen;       // returns the KP_Open function
  50. } KP_INIT;
  51.  
  52. // You must define KP_Init() functions in order to link the device driver
  53. BOOL __cdecl KP_Init(KP_INIT *kpInit);
  54.  
  55. #ifdef __cplusplus
  56.     }
  57. #endif  // __cplusplus 
  58.  
  59. #endif // _WD_KP_H_
  60.